package com.neusoft.mapper;

import com.neusoft.po.Virtualwallet;

import org.apache.ibatis.annotations.*;
import java.math.BigDecimal;

@Mapper
public interface VirtualwalletMapper {

    @Select("select * from wallet where userId=#{userId}")
    public Virtualwallet GetVirtualwalletByUserId(@Param("userId")String userId);

    @Insert("insert into wallet (userId,balance) values (#{userId},0)")
    public int saveVirtualwallet(@Param("userId")String userId);

    @Update("update wallet set balance = #{balance} where userId = #{userId}")
    public int updateVirtualwallet(@Param("userId")String userId,@Param("balance")BigDecimal balance);
}
